<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Complaint>" %>

<%@ Import Namespace="Complaint.Common" %>
<%@ Import Namespace="Complaint.Models.Dtos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <title>Make a complaint</title>
    <meta name="description" content="make a complaint on icomplain" />
    <meta name="keywords" content="Make a complaint,complain" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% var organisation = (Organisation)ViewData["Organisation"]; %>
    <h2>
        Make a complaint against
        <%= organisation.Name %></h2>
    <% using (Html.BeginForm("Create", "Complaint", FormMethod.Post, new { enctype = "multipart/form-data" }))
       {%>
    <%= Html.ValidationSummary(false) %>
    <p>
        Note: * marked are required fields.</p>
    <fieldset>
        <legend>Complaint details</legend>
        <p>
            <label for="Title">
                Title:</label>
            <em>*</em><%= Html.TextBox("Title", null, new { maxlength = 100 }) %>
            <%= Html.ValidationMessage("Title", "Field required") %>
        </p>
        <p>
            <label for="Body">
                Complaint:</label><br />
            <span><em>*</em><%= Html.TextArea("Body", new { style = "width:95%;height:200px;" }) %>
                <%= Html.ValidationMessage("Body", "Field required") %>
                Note: Max length is 8000 characters.</span>
        </p>
        <p>
            <label for="OrganisationRef">
                Organisation Ref:</label>
            <em>&nbsp;</em><%= Html.TextBox("OrganisationRef", null, new { maxlength = 50 })%>
            <%= Html.ValidationMessage("OrganisationRef") %>
        </p>
        <p>
            <%= Html.LabelFor(model => model.Proof) %>
            <em>&nbsp;</em><input type="file" name="Proof" id="Proof" />
            <%= Html.ValidationMessage("Proof") %>
            <span>Note: Max file size is
                <%= ConfigHelper.GetConfigValue("MaxFileSize") %>
                bytes.</span>
        </p>
        <p>
            <label for="PassOn">
                Forward to
                <%= organisation.Name %>:</label>
            <em>&nbsp;</em><%= Html.CheckBoxFor(model => model.PassOn)%>
        </p>
        <p>
            <label for="AgreedToTnc">
                Agree to our <a href="<%= Url.Content("~/Home/TNC") %>" target="_blank">T&amp;C</a>:</label>
            <em>*</em><%= Html.CheckBoxFor(model => model.AgreedToTnc)%>
            <%= Html.ValidationMessageFor(model => model.AgreedToTnc)%>
        </p>
        <p>
            <button id="save" class="formbutton">
                Save</button>
        </p>
    </fieldset>
    <% } %>
</asp:Content>
